﻿using System;
using System.Collections.Specialized;

namespace MyLib.Web.UI {
	/// <summary>
	/// 
	/// </summary>
#if FALSE
	[Flags]
#endif
	public enum CascadedAction {
		/// <summary>
		/// 
		/// </summary>
		None = 0,

#if FALSE

		/// <summary>
		/// 
		/// </summary>
		Insert = 1,

		/// <summary>
		/// 
		/// </summary>
		Update = 2,

		/// <summary>
		/// 
		/// </summary>
		Delete = 4,

#endif

		/// <summary>
		/// 
		/// </summary>
		Save = 7
	}

	/// <summary>
	/// 
	/// </summary>
	public interface ICascadedControl {
		/// <summary>
		/// 
		/// </summary>
		CascadedAction CascadedAction { get; set; }

		/// <summary>
		/// 
		/// </summary>
		/// <param name="oldValues"></param>
		/// <param name="newValues"></param>
		void Saving(IOrderedDictionary oldValues, IOrderedDictionary newValues);

#if FALSE

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		int Insert();

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		int Update();

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		int Delete();

#endif

		/// <summary>
		/// 
		/// </summary>
		/// <param name="oldValues"></param>
		/// <param name="newValues"></param>
		/// <returns></returns>
		int Save(IOrderedDictionary oldValues, IOrderedDictionary newValues);
	} // end of ICascadedControl.
}
